﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Mappings;

namespace Apollo
{
    [NHibernateEntity(Table = "Insured")]
    public class Insured : ITrackable, ILegacy
    {
        public Insured() { }

        [PrimaryKey]
        public virtual int Id { get; set; }

        [BelongsTo(Column = "ID_Contact")]
        public virtual Contact Contact { get; set; }

        [BelongsTo(Column = "ID_ContractProduct")]
        public virtual ContractProduct ContractProduct { get; set; }

        [Property]
        public virtual string FirstName { get; set; }

        [Property]
        public virtual string LastName { get; set; }

        [Property(Formula = "(FirstName + ' ' + LastName)")]
        public virtual string FullName { get; set; }

        [Property]
        public virtual string Code { get; set; }

        [Property]
        public virtual string Phone { get; set; }

        [Property]
        public virtual string Phone2 { get; set; }

        [Property]
        public virtual string Mobile { get; set; }

        [Property]
        public virtual string Fax { get; set; }

        [Property]
        public virtual string Mail { get; set; }

        [Property]
        public virtual string Address { get; set; }

        [Property]
        public virtual Gender Gender { get; set; }

        [Property]
        public virtual DateTime BirthDate { get; set; }


        [Property]
        public virtual InsuredType InsuredType { get; set; }

        [Property]
        public virtual string LegacyApplication { get; set; }

        [Property]
        public virtual string LegacyID { get; set; }


        [Property]
        public virtual DateTime InsertDate { get; set; }

        [Property]
        public virtual string InsertBy { get; set; }

        [Property]
        public virtual DateTime? ModifiedDate { get; set; }

        [Property]
        public virtual string ModifiedBy { get; set; }
    }

    public enum InsuredType { 
        Insured = 0,
        Dependent = 1
    }

    public enum Gender { 
        M = 1,
        F = 2
    }
}
